package com.redpack.redpost.struts.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import com.redpack.redpost.util.to.HTMLEntities;

public class comentariosForm extends ActionForm {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String comentario ;
	private int acc ;
	private int cve ;

	public int getCve() {
		return cve;
	}


	public void setCve(int cve) {
		this.cve = cve;
	}


	public String getComentario() {
		return comentario;
	}


	public void setComentario(String comentario) {
		this.comentario = comentario;
	}


	public int getAcc() {
		return acc;
	}


	public void setAcc(int acc) {
		this.acc = acc;
	}


	public static long getSerialversionuid() {
		return serialVersionUID;
	}


	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request){
		
		ActionErrors errors = new ActionErrors() ;

		if( acc != 0 ){
			
			comentario = HTMLEntities.htmlentities(comentario);
			comentario = HTMLEntities.htmlAngleBrackets(comentario);
			comentario = HTMLEntities.htmlQuotes(comentario);
			
		}
		request.setAttribute("submenu", "mis_comentarios");
		return errors ;
		
	}

}